#!/usr/bin/python3
# -*- coding:utf-8 -*-
""""
@Author: 李吉凯
@Email: lijk34925@hundsun.com
@Time: 2022/12/12 16:41
@File: 非现场监管报表.py
"""
from BladeFerm.Lib.Common import data_processing
from BladeFerm.hui12_common.check_data import check_data_contains
from BladeFerm.hui2_app import FE
from BladeFerm.hui2_app.hui2_lib.home_tab import HomeTab
from Project.证券风险监控.web应用.qturboframe.lib.utils.by import By
from 基础公共脚本.公共方法_hui2 import open_menu

# 非现场监管报表_查询
from 基础公共脚本.步骤检查_hui2 import check_ele_text


@data_processing
def off_site_report_config(input_data=None, ui_expect=None):
    menu_name = input_data.get("菜单名称")
    open_menu({'子系统名称': '反洗钱系统', '菜单名称': '非现场监管报表/非现场监管报表'})

    table = FE.table_new()
    table.click_cell(input_data.get("定位数据"), {"操作": "查看"})

    # 检查查询结果
    home_tab = HomeTab(menu_name, idname={By.CSS_SELECTOR: 'div.h-layout-tabbar'}, father=FE.driver, timeout=5)
    cur_tabs = home_tab.get_tabs_text()
    check_data_contains(ui_data=ui_expect.get("新标签页"), original_data=cur_tabs)
    check_ele_text(input_data=None, ui_expect=ui_expect)